package com.winkey.facility.gateway.service.parser.impl;

import com.alibaba.fastjson.JSONObject;
import com.winkey.facility.gateway.service.parser.DataParse;
import org.springframework.stereotype.Component;

/**
 * @author Administrator
 */
@Component
public class SimpleDataParse implements DataParse {

    @Override
    public Object simpleDataParse(Object o, Class clazz,String tag) {
        if(clazz.equals(String.class)){
            JSONObject jsonObject = JSONObject.parseObject((String)o);
            return "Bearer "+((String)jsonObject.get(tag));
        }
        return null;
    }
}
